<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let num1 = 100;
        console.log(num1+100);

        let num2 = '100';
        // + 代表连接
        console.log(num2+100);
        // 其他都可以正常运算
        console.log(num2-100);
        console.log(num2*100);
        console.log(num2/100);
        // Number 将字符串形式的数字进行转换
        console.log(Number(num2)+100);

        // parseInt 取整
        let num3 = '100px';
        console.log(parseInt(num3)+100);
        // parseFloat 取小数部分
        let num4 = '100.5px';
        console.log(parseFloat(num4)+100);
    </script>
</body>
</html>